-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
local opt = vim.opt

-- 当文件被外部程序修改时，自动加载
opt.autoread = true
vim.bo.autoread = true

--不显示相对行数
opt.relativenumber = false

--备份文件
opt.backup = false

--自动折行显示
opt.wrap = true
opt.showbreak = "↪ "

opt.conceallevel = 0

vim.g.autoformat = false

vim.g.lazyvim_python_ruff = "ruff"
-- vim.g.lazyvim_python_lsp = "pylsp"
vim.g.lazyvim_python_lsp = "basedpyright"
-- vim.g.lazyvim_python_lsp = "ruff"

-- opt.background="dark"

-- In case you don't want to use `:LazyExtras`,
-- then you need to set the option below.
vim.g.lazyvim_picker = "snacks"

-- Snacks animations
-- Set to `false` to globally disable all snacks animations
vim.g.snacks_animate = false

-- Enable OSC 52 for clipboard
vim.o.clipboard = "unnamedplus"

local function paste()
  return {
    vim.fn.split(vim.fn.getreg(""), "\n"),
    vim.fn.getregtype(""),
  }
end
vim.g.clipboard = {
  name = "OSC 52",
  copy = {
    ["+"] = require("vim.ui.clipboard.osc52").copy("+"),
    ["*"] = require("vim.ui.clipboard.osc52").copy("*"),
  },
  paste = {
    ["+"] = paste,
    ["*"] = paste,
  },
}
-- 禁用内置 inlay hints，避免 vuels/volar 报错
if vim.lsp.inlay_hint then
  vim.lsp.inlay_hint.enable(false)
end
